import { Model, Table, Column,Default,DataType } from 'sequelize-typescript'

/*
* 用户权限表
* */
@Table
export default class UserAuth extends Model<UserAuth> {
  @Column({
    comment: '自增ID',
    autoIncrement: true,
    primaryKey: true,
  })
  id: number

  @Column({
    comment: '用户id',
  })
  user_id: number

  @Default('username')
  @Column({
    type:DataType.ENUM('username','email','phone','weixin','weibo'),
    comment: '身份类型',
  })
  identity_type: string

  @Column({
    comment: '标识',
  })
  identifier: string

  @Column({
    comment:'凭证'
  })
  credential:string
}
